<%--
  Created by IntelliJ IDEA.
  User: aaa
  Date: 2024/6/26
  Time: 1:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            position: relative; /* 为了让fixed元素相对于整个body定位 */
        }

        .outer {
            position: fixed; /* 将外层div设置为固定定位 */
            bottom: 0; /* 使div位于页面底部 */
            left: 0; /* 使div位于页面左侧 */
            width: 300px;
            height: 300px;
            background-color: #f0f0f0;
        }

        .inner {
            position: absolute; /* 内层div保持绝对定位 */
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 100px;
            height: 100px;
            background-color: #c0c0c0;
        }
    </style>
</head>
<body>

<div class="outer">
    <div class="inner">
        中间div
    </div>
</div>

</body>
</html>